package com.letfox.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.letfox.user.dao.ContactDao;
import com.letfox.user.model.UContact;
import com.letfox.user.service.ContactService;

@Service
public class ContactServiceImpl implements ContactService {

	@Autowired
	private ContactDao contactDao;
	
	@Override
	public int save(UContact contact) {
		return contactDao.insert(contact);
	}

	@Override
	public int update(UContact contact) {
		return contactDao.update(contact);
	}

	@Override
	public int deleteById(Long id) {
		return contactDao.deleteById(id);
	}

	@Override
	public int deleteByIds(String ids) {
		return contactDao.deleteByIds(ids);
	}

	@Override
	public UContact getById(Long id) {
		return contactDao.selectById(id);
	}

	@Override
	public List<UContact> getList(UContact contact) {
		return contactDao.selectList(contact);
	}

	@Override
	public UContact getByTypeAndValue(String type, String value) {
		return contactDao.selectByTypeAndValue(type, value);
	}

}
